border-image-repeat: Fix order of hrepeat and vrepeat
authorBenjamin Otte <otte@redhat.com>
Wed, 8 Jun 2011 05:04:38 +0000 (07:04 +0200)
committerBenjamin Otte <otte@redhat.com>
Thu, 9 Jun 2011 03:51:54 +0000 (05:51 +0200)
gtk/gtkborderimage.c
gtk/gtkstyleproperty.c

index bc9e3a634431b58eee6200734020f9cbf9b1d7b9..499bbe42d351319ac053894b7a146091f154549d 100644 (file)
@@ -311,18 +311,18 @@ render_border (cairo_t              *cr,
       target_x = border_area->left;
       target_y = (side == SIDE_TOP) ? 0 : (total_height - border_area->bottom);
 
-      if (repeat->vrepeat == GTK_CSS_REPEAT_STYLE_NONE)
+      if (repeat->hrepeat == GTK_CSS_REPEAT_STYLE_NONE)
         {
           target_width = image_area.width;
         }
-      else if (repeat->vrepeat == GTK_CSS_REPEAT_STYLE_REPEAT)
+      else if (repeat->hrepeat == GTK_CSS_REPEAT_STYLE_REPEAT)
         {
           repeat_pattern = TRUE;
 
           target_x = border_area->left + (total_width - border_area->left - border_area->right) / 2;
           target_y = ((side == SIDE_TOP) ? 0 : (total_height - border_area->bottom)) / 2;
         }
-      else if (repeat->vrepeat == GTK_CSS_REPEAT_STYLE_ROUND)
+      else if (repeat->hrepeat == GTK_CSS_REPEAT_STYLE_ROUND)
         {
           gint n_repeats;
 
@@ -331,7 +331,7 @@ render_border (cairo_t              *cr,
           n_repeats = (gint) floor (image_area.width / surface_width);
           target_width = image_area.width / n_repeats;
         }
-      else if (repeat->vrepeat == GTK_CSS_REPEAT_STYLE_SPACE)
+      else if (repeat->hrepeat == GTK_CSS_REPEAT_STYLE_SPACE)
         {
           cairo_surface_t *spaced_surface;
 
@@ -356,11 +356,11 @@ render_border (cairo_t              *cr,
       target_x = (side == SIDE_LEFT) ? 0 : (total_width - border_area->right);
       target_y = border_area->top;
 
-      if (repeat->hrepeat == GTK_CSS_REPEAT_STYLE_NONE)
+      if (repeat->vrepeat == GTK_CSS_REPEAT_STYLE_NONE)
         {
           target_height = total_height - border_area->top - border_area->bottom;
         }
-      else if (repeat->hrepeat == GTK_CSS_REPEAT_STYLE_REPEAT)
+      else if (repeat->vrepeat == GTK_CSS_REPEAT_STYLE_REPEAT)
         {
           repeat_pattern = TRUE;
 
@@ -368,7 +368,7 @@ render_border (cairo_t              *cr,
           target_x = (side == SIDE_LEFT) ? 0 : (total_width - border_area->right) / 2;
           target_y = border_area->top + (total_height - border_area->top - border_area->bottom) / 2;
         }
-      else if (repeat->hrepeat == GTK_CSS_REPEAT_STYLE_ROUND)
+      else if (repeat->vrepeat == GTK_CSS_REPEAT_STYLE_ROUND)
         {
           gint n_repeats;
 
@@ -377,7 +377,7 @@ render_border (cairo_t              *cr,
           n_repeats = (gint) floor (image_area.height / surface_height);
           target_height = image_area.height / n_repeats;
         }
-      else if (repeat->hrepeat == GTK_CSS_REPEAT_STYLE_SPACE)
+      else if (repeat->vrepeat == GTK_CSS_REPEAT_STYLE_SPACE)
         {
           cairo_surface_t *spaced_surface;
 
index 5e105a75a02433d643fc9cc06a025c4a7cd8150f..d707091725f546d12d5754360a390de3e9061f58 100644 (file)
@@ -976,8 +976,8 @@ border_image_repeat_value_parse (GtkCssParser *parser,
         styles[i] = styles[0];
     }
 
-  image_repeat.vrepeat = styles[0];
-  image_repeat.hrepeat = styles[1];
+  image_repeat.hrepeat = styles[0];
+  image_repeat.vrepeat = styles[1];
 
   g_value_set_boxed (value, &image_repeat);
 
@@ -1011,8 +1011,8 @@ border_image_repeat_value_print (const GValue *value,
   image_repeat = g_value_get_boxed (value);
 
   g_string_append_printf (string, "%s %s",
-                          border_image_repeat_style_to_string (image_repeat->vrepeat),
-                          border_image_repeat_style_to_string (image_repeat->hrepeat));
+                          border_image_repeat_style_to_string (image_repeat->hrepeat),
+                          border_image_repeat_style_to_string (image_repeat->vrepeat));
 }
 
 static gboolean